<script setup lang="ts">
defineProps<{
  modelValue: number,
  car: string,
  house: string
}>()

const emits = defineEmits<{
  (e: 'update:modelValue', money: number): void
  (e: 'update:car', car: string): void
  (e: 'update:house', car: string): void
}>()
</script>

<template>
  <div class="child-one">
    <div>子组件</div>
    <p>钱包: {{ modelValue }}</p>
    <button @click="emits('update:modelValue', modelValue + 20000)">搬砖一个月</button>
    <p>--------------------</p>
    <p>车: {{ car }}</p>
    <button @click="emits('update:car', '小米su7')">换车</button>
    <p>--------------------</p>
    <p>房子: {{ house }}</p>
    <button @click="emits('update:house', '城市茅屋')">换车</button>
  </div>
</template>

<style scoped>
.child-one {
  width: 200px;
  height: 200px;
  background-color: pink;
}
</style>
